package org.dromara.business.domain;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import jakarta.validation.constraints.Digits;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.tenant.core.TenantEntity;

import java.io.Serial;
import java.math.BigDecimal;

/**
 * 任务对象 goods
 *
 * @author zlj
 * @date 2024-08-01
 */
@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@TableName("goods")
public class Goods extends TenantEntity {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @NotNull(message = "任务价格不能为空", groups = {EditGroup.class})
    @TableId(value = "goods_id")
    private Long goodsId;
    /**
     * 接单人id
     */
    private Long userId;

    /**
     * 任务名称
     */
    @NotBlank(message = "任务名称不能为空", groups = {AddGroup.class, EditGroup.class})
    private String name;

    /**
     * 用户头像
     */
    private String userProfile;

    /**
     * 任务图片id
     */
    private Long url;

    /**
     * 任务价格
     */
    @NotNull(message = "任务价格不能为空", groups = {AddGroup.class, EditGroup.class})
    @Digits(integer = 8, fraction = 2, message = "任务价格格式不正确", groups = {AddGroup.class, EditGroup.class})
    private BigDecimal price;

    /**
     * 帐号状态（1下架  2上架(默认) 3派送中 4已送达 5已完成）
     */
    private String status;

    /**
     * 任务介绍
     */
    private String info;
    /**
     * 快递点
     */
    @NotNull(message = "快递点不能为空", groups = {AddGroup.class, EditGroup.class})
    private String expressPoint;
    @NotNull(message = "收货地址不能为空", groups = {AddGroup.class, EditGroup.class})
    private String address;
    @NotNull(message = "快递大小不能为空", groups = {AddGroup.class, EditGroup.class})
    private String size;
    private Long sizeId;
    private BigDecimal sizePrice;
    @NotNull(message = "快递重量不能为空", groups = {AddGroup.class, EditGroup.class})
    private String weight;
    private Long weightId;
    private BigDecimal weightPrice;
    @NotNull(message = "联系人电话不能为空", groups = {AddGroup.class, EditGroup.class})
    private String phone;
    @NotNull(message = "送达地点不能为空", groups = {AddGroup.class, EditGroup.class})
    private String area;
    private Long areaId;
    private BigDecimal areaPrice;
    @NotNull(message = "取件码不能为空", groups = {AddGroup.class, EditGroup.class})
    private String code;
    @NotNull(message = "送达时间不能为空", groups = {AddGroup.class, EditGroup.class})
    private String endTime;
    /**
     * 删除标志（0代表存在 2代表删除）
     */
    @TableLogic
    private String delFlag;

}
